<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>路由列表</title>


<!-- Bootstrap Core CSS -->
<link
	href="../../res/js/sbadmin2/vendor/bootstrap/css/bootstrap.min.css"
	rel="stylesheet">

<!-- MetisMenu CSS -->
<link href="../../res/js/sbadmin2/vendor/metisMenu/metisMenu.min.css"
	rel="stylesheet">

<!-- DataTables CSS -->
<link
	href="../../res/js/sbadmin2/vendor/datatables-plugins/dataTables.bootstrap.css"
	rel="stylesheet">

<!-- DataTables Responsive CSS -->
<link
	href="../../res/js/sbadmin2/vendor/datatables-responsive/dataTables.responsive.css"
	rel="stylesheet">

<!-- Custom CSS -->
<link href="../../res/js/sbadmin2/dist/css/sb-admin-2.css"
	rel="stylesheet">

<!-- Custom Fonts -->
<link
	href="../../res/js/sbadmin2/vendor/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">


<!-- jQuery -->
<script src="../../res/js/sbadmin2/vendor/jquery/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="../../res/js/sbadmin2/vendor/bootstrap/js/bootstrap.min.js"></script>

<!-- Metis Menu Plugin JavaScript -->
<script src="../../res/js/sbadmin2/vendor/metisMenu/metisMenu.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="../../res/js/sbadmin2/dist/js/sb-admin-2.js"></script>

<script type="text/javascript"
	src="../../res/js/jquery-validate/jquery.validate.js"></script>
<script type="text/javascript"
	src="../../res/js/jquery-validate/localization/messages_zh.js"></script>
<script type="text/javascript" src="../../res/js/hoyi/hoyi-req.js"></script>

<script src="../../res/js/hoyi/hoyi-req-serverpost-v.3.15.js"></script>




<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
		function AddRoute(){
			$('#modiModal').modal();
		}

		function AddRouteRule(target){
			var serviceID = $(target).attr('serviceid');
			$('#ruleserviceID').val(serviceID);
			$('#routemodal').modal();
		}

		$(document).ready(function() {
		});
	</script>
</head>

<body>

	<!-- Add,Modi Modal -->
	<div class="modal fade" id="nginxconfmodal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="addmodallabel">添加路由规则</h4>
				</div>
				<div id="addmodalbody" class="modal-body">
					<textarea id="txnginxconfig" rows="3" cols="20" style="width: 100%; min-height: 400px;">
					
					</textarea>
				</div>
			</div>
		</div>
	</div>

	<!-- Add,Modi Modal -->
	<div class="modal fade" id="routemodal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="addmodallabel">添加路由规则</h4>
				</div>
				<div id="addmodalbody" class="modal-body">
					<form id="ruleform" class="form-horizontal">

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> ServiceID</label>

							<div class="col-sm-9">
								<input type="text" name="ruleserviceID" id="ruleserviceID"
									placeholder="" required=""
									class="form-control col-xs-10 col-sm-5"> <span
									class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> Localtion</label>

							<div class="col-sm-9">
								<input type="text" name="rulelocation" id="rulelocation"
									placeholder="" required=""
									class="form-control col-xs-10 col-sm-5"> <span
									class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> Proxy_Pass</label>

							<div class="col-sm-9">
								<input type="text" name="proxypass" id="proxypass"
									placeholder="" class="form-control col-xs-10 col-sm-5">
								<span class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> LOCALURL</label>

							<div class="col-sm-9">
								<input type="text" name="localurl" id="localurl" placeholder=""
									class="form-control col-xs-10 col-sm-5"> <span
									class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>

						<div class="space-4"></div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> Providers</label>

							<div class="col-sm-9">
								<input type="text" name="providers" id="providers"
									placeholder="" class="form-control col-xs-10 col-sm-5">
								<span class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> 备注</label>

							<div class="col-sm-9">
								<input type="text" name="rulenotes" id="rulenotes"
									placeholder="" class="form-control col-xs-10 col-sm-5">
								<span class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>


						<div class="modal-footer">
							<button class="btn btn-primary"
								OnBeforeClick="validateForm('#ruleform');" ServerCtrl="true"
								OnHoyiClick="AddRules">添加</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">Close</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	<!-- Add,Modi Modal -->
	<div class="modal fade" id="modiModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="addmodallabel">添加路由器</h4>
				</div>
				<div id="addmodalbody" class="modal-body">
					<form id="modiaddform" class="form-horizontal">

						<div class="form-group" style="display: none;">
							<input type="text" name="routeruuid" id="routeruuid"
								placeholder="" class="form-control col-xs-10 col-sm-5">
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> 路由ID(服务ID)</label>

							<div class="col-sm-9">
								<input type="text" name="routeserviceid" id="routeserviceid"
									placeholder="" required=""
									class="form-control col-xs-10 col-sm-5"> <span
									class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>


						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> Host</label>

							<div class="col-sm-9">
								<input type="text" name="routerhost" id="routerhost"
									placeholder="" class="form-control col-xs-10 col-sm-5">
								<span class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> 端口</label>

							<div class="col-sm-9">
								<input type="text" name="routeport" id="routeport"
									placeholder="" class="form-control col-xs-10 col-sm-5">
								<span class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right"
								for="form-field-1"> 备注</label>

							<div class="col-sm-9">
								<input type="text" name="routenotes" id="routenotes"
									placeholder="" class="form-control col-xs-10 col-sm-5">
								<span class="help-inline col-xs-12 col-sm-7"> <span
									class="middle"></span>
								</span>
							</div>
						</div>
						<div class="space-4"></div>


						<div class="modal-footer">
							<button id="btnModiSubmits" class="btn btn-primary"
								OnBeforeClick="validateForm('#modiaddform');" ServerCtrl="true"
								OnHoyiClick="AddRoute">添加</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">Close</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	<div class="panel panel-default"
		style="border-radius: 0px; border: 0px;">
		<div class="panel panel-default" style="margin-bottom: 0px;">
			<div class="panel-heading">
				<div class="btn-group" role="group" aria-label="...">
					<a class="btn btn-default" onclick="AddRoute();"> <span
						class="glyphicon glyphicon-plus" style="color: green;"
						aria-hidden="true"></span> 添加路由器
					</a>
					<a class="btn btn-default" ServerCtrl="true" OnHoyiClick="BuildConfigs">
								 <span
						class="glyphicon glyphicon-plus" style="color: green;"
						aria-hidden="true"></span> 生成配置
					</a>
					<a class="btn btn-default" ServerCtrl="true" OnHoyiClick="PublishRoute"> <span
						class="glyphicon glyphicon-plus" style="color: green;"
						aria-hidden="true"></span> 发布路由
					</a>
					<div class="input-group" style="width: 30%; margin-left: 70%;">
						<input type="text" class="form-control" id="txfilter"
							name="locfilter" placeholder="输入查询条件"> <span
							class="input-group-btn">
							<button class="btn btn-default" type="button" onclick="pgc(1);">查询</button>
						</span>
					</div>
				</div>
			</div>
		</div>
		<!-- /.panel-heading -->
		<div class="panel-body">

			<table width="100%"
				class="table table-striped table-bordered table-hover"
				id="dataTables-example">
				<thead>
					<tr>
						<th>路由ID(ServiceID)</th>
						<th>Host</th>
						<th>端口</th>
						<th>状态</th>
						<th>路由</th>
						<th></th>
					</tr>
				</thead>
				<tbody id="routerbody"><%# GetRouterInfos() #%>
				</tbody>
			</table>

			<table width="100%"
				class="table table-striped table-bordered table-hover"
				id="dataTables-example">
				<thead>
					<tr>
						<th>Service</th>
						<th>Provider</th>
						<th></th>
					</tr>
				</thead>
				<tbody><%# GetServiceInfo() #%>

				</tbody>
			</table>

		</div>
		<!-- /.panel-body -->
	</div>
	<!-- /.panel -->
</body>

</html>
